import { request } from '../configs';
import makeApi from './index';

const defaultData = {
	query: {
		searchCount: true,
		openSort: true,
		isAsc: false,
		orderByField: 'ctime',
		size: 10000
	}
};

const api = {
	query: '/sys/sysPermission/getListByPage',
	create: '/sys/sysPermission/add',
	update: '/sys/sysPermission/update',
	remove: '/sys/sysPermission/delete'
};

const services = makeApi(api);
services.query = function query(params) {
	return request({
		url: api.query,
		method: 'post',
		data: params || defaultData.query,
	});
  };

const {
	query,
	create,
	update,
	remove,
} = services;

export {
	query,
	create,
	update,
	remove,
};
export default services;
